<?php
class User extends CI_Controller{
	public function view($page='user'){
		if(! file_exists('uja-tbw-1213/views/user/'.$page.'.php')){
			//Whoops we don't have a page for that!
			show_404();
		}
		$data['title']=ucfirst($page);

		$this->load->view('templates/header.php', $data);
		$this->load->view('user/'.$page, $data);
		$this->load->view('templates/footer', $data);
	}

	
	// Ladis
	public function login(){
		$data=array();
		$this->load->view('templates/header.php', $data);
		$this->load->view('user/login', $data);
		$this->load->view('templates/footer', $data);
	}

	// Jose
	public function logout(){
		$this->load->view('templates/header.php', $data);
		$this->load->view('user/login', $data);
		$this->load->view('templates/footer', $data);
	}

	// David
	public function new_user(){
		$data = array();
		$this->load->view('templates/header.php', $data);
		$this->load->view('user/new', $data);
		$this->load->view('templates/footer', $data);
	}

	// Vicente
	public function register(){
    	$this->load->view('templates/header.php', $data);
		$this->load->view('user/confirm'.$page, $data);
		$this->load->view('templates/footer', $data);
	}

	// Paredes
	public function profile(){
    	$this->load->view('templates/header.php', $data);
		$this->load->view('user/profile'.$page, $data);
		$this->load->view('templates/footer', $data);
	}

	// Ladis
	public function list_users(){
<<<<<<< HEAD

=======
		$query = $this->db->query("SELECT * FROM user");
		$data = array();
		$data['users'] = $query->result();
		$this->load->view('templates/header.php', $data);
		$this->load->view('user/list', $data);
		$this->load->view('templates/footer', $data);
>>>>>>> 67c99d3d1d51ae16e1c68cfe43bfa083618d5543
	}

	// Jose
	public function validate(){
		
	}
}